<?php
class m_tingkat_kepentingan_kriteria extends Model{
    var $table = 'tingkat_kepentingan_kriteria';
    
    function getListTingkatKepentinganKriteria($id = NULL){
        $result = array();
        if($id != NULL){
            $where = "where id = '$id'";
        }else $where = '';
        
        $query = $this->db->query("select * from tingkat_kepentingan_kriteria $where");
        if($query->num_rows() > 0){
            $result = $query->result_array();
        }else $result = array();
        
        return $result;
    }
    function addTingkatKepentinganKriteria($data){
        $insert = $this->db->insert($this->table,$data);
        
        if($insert){
            return TRUE;
        }else return FALSE;
    }
    function editTingkatKepentinganKriteria($data){
        $this->db->where('id',$data['id']);
        $update = $this->db->update($this->table,$data);
        if($update){
            return TRUE;
        }else return FALSE;
    }
    function deleteTingkatKepentinganKriteria($id){
        $delete = $this->db->delete($this->table,array('id'=>$id));
        if(!$delete){
            return FALSE;
        }else return TRUE;
    }
}
?>
